package com.pk.android.model;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class BaseFragment extends Fragment {
	public String title;
	public View view;
	public static final String EXTRA_TITLE = "EXTRA_TITLE";

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
	{
		// Inflate the layout for this fragment
    	//String title = "";
    	if(getArguments() != null && getArguments().containsKey(EXTRA_TITLE))
    		title = getArguments().getString(EXTRA_TITLE);
    	
    	if (view != null) {
            ViewGroup parent = (ViewGroup) view.getParent();
            if (parent != null)
                parent.removeView(view);
        }
    	
		return view;
	}
}
